// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import axios from 'axios'
import VueAxios from 'vue-axios'
import qs from 'qs'
import Vuex from 'vuex'
import store from './store'
import 'element-ui/lib/theme-chalk/index.css'
import ShopeeUI from 'shopee-ui';
import 'shopee-ui/lib/theme-default/index.css';
import VueCookies from 'vue-cookies'
Vue.use(VueCookies)

Vue.config.productionTip = false
Vue.prototype.$qs = qs
Vue.use(ElementUI)
Vue.use(ShopeeUI)
Vue.use(Vuex)
Vue.use(VueAxios, axios)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})

String.prototype.format= function(){
  //将arguments转化为数组（ES5中并非严格的数组）
  var args = Array.prototype.slice.call(arguments);
  var count=0;
  //通过正则替换%s
  return this.replace(/%s/g,function(s,i){
    return args[count++];
  });
}
